<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/custom-html.tld" prefix="chtml" %>

<%@ page import="com.erp.framework.util.CommonUtil"%>
<%@ page import="com.erp.app.common.ProjectConstants"%>
<%@ page import="com.erp.app.catalog.login.web.CategoryItemCategoryRow"%>
<%@ page import="com.erp.app.catalog.login.web.CategoryItemClassRow"%>
<%@ page import="com.erp.app.catalog.category.vo.CategoryItemLineVO"%>
<%@ page import="com.erp.app.catalog.category.vo.CategoryItemCategoryVO"%>
<%@ page import="com.erp.app.catalog.category.vo.CategoryItemClassVO"%>
<%@ page import="com.erp.app.catalog.login.web.CatalogLoginAction"%>

<%@ page import="java.util.ArrayList"%>
<%@ page import="java.util.Hashtable"%>
<%@ page import="java.util.HashMap"%>
<%@ page import="java.util.Iterator"%>

<jsp:useBean id="catalogLoginForm" scope="session" type="com.erp.app.catalog.login.web.CatalogLoginForm" />

<%
	ArrayList al = null;
	al = catalogLoginForm.getCategoryItemLineVos();
	pageContext.setAttribute("itemLineVos", al);
%>

<meta http-equiv="Content-Type" content="text/html; charset=big5">
<link rel="stylesheet" href="stylesheet/style1.css" type="text/css">
<link href="<%= request.getContextPath()%>/css/catalogCss/global.css" rel="stylesheet" type="text/css" />
<link href="<%= request.getContextPath()%>/css/catalogCss/buttons.css" rel="stylesheet" type="text/css" />
<link href="<%= request.getContextPath()%>/css/catalogCss/forms.css" rel="stylesheet" type="text/css" />
<link href="<%= request.getContextPath()%>/css/catalogCss/tables.css" rel="stylesheet" type="text/css" />
	

	
	<table width="95%" border="0" cellpadding="0" cellspacing="1" id="search_advanced">
		<tr >
		  <td height="30" colspan=2 ><h4>Please input the Searching criteria</h4></td>
		</tr>
		<tr class="search_advanced_tr" >
			<td width="25%" height="24" class="search_advanced_td">
				<html:text useExtensions="true" uiType="label" name="catalogLoginForm" property="lblCategoryArticleOptional"/>
			</td>
			<td width="75%" id="advanced_search_box">
				<html:text name="catalogLoginForm" property="srchArticleNo" style="border: 1px solid #7F9DB9; height: 18px;" size="40" maxlength="255"  />
							&nbsp;&nbsp;
				<input type="button" name="btn_search" class="submit" onClick="javascript:doSubmit('<%=CatalogLoginAction.ACTION_SEARCH_EXTRA%>','advanceSearch');" value="Search"/>
			</td>
		</tr>
		<tr class="search_advanced_tr">
			<td height="24 class="search_advanced_td">
				<html:text useExtensions="true" uiType="label" name="catalogLoginForm" property="lblCategoryMainCategory"/>
			</td>
			<td class="search_advanced_td"> 						
				
	  	       <html:select property="srchMainCat" styleClass="t2" onchange="doSubmit('advanceSearch');">
					<option value=""/>
					<html:options collection="itemLineVos" property="itemLine" labelProperty="itemLineDesc"/>
				</html:select>
			</td>
		</tr>
		<logic:present  name="catalogLoginForm" property="srchMainCat">		
			<logic:present  name="itemLineVos">
				<logic:iterate id="itemLineVo" name="itemLineVos" indexId="idx"  type="com.erp.app.catalog.category.vo.CategoryItemLineVO">
					<logic:iterate id="itemCategoryVo" name="itemLineVo" property="itemCategoryVos" indexId="subIdx"	type="com.erp.app.catalog.category.vo.CategoryItemCategoryVO">
						<logic:equal name="itemCategoryVo" property="itemLine" value="<%= catalogLoginForm.getSrchMainCat() %>">
							<tr>
								<td class="search_advanced_tr">									
									<bean:write name="itemCategoryVo" property="categoryItemCategoryDesc"/>
								</td>
								<td class="search_advanced_tr">
									<table border="0" cellpadding="2" cellspacing="5" class="search_advanced">
									<logic:iterate id="itemClassVo" name="itemCategoryVo" property="itemClassVos" indexId="subDtlIdx"  type="com.erp.app.catalog.category.vo.CategoryItemClassVO">	
										<%=(subDtlIdx.intValue()%4==0)?"<tr>":""%>
											<td width="25%"><input type="checkbox" name="srchSubCatDtl" style="width:15px" value="<%=itemClassVo.getItemClass()%>"/>&nbsp;
											<bean:write name="itemClassVo" property="classItemClassDesc"/></td>
										<%=(subDtlIdx.intValue()%4==3)?"</tr>":""%>
									</logic:iterate>
									</table>
								</td>
							</tr>
						</logic:equal>
					</logic:iterate>
				</logic:iterate>
			</logic:present>
		</logic:present>	
	</table> 
